
function handleClick(img) {
 $("#productName").text("שם :" +img.getAttribute("title"));
 $("#productDesc").text("תיאור :" +img.getAttribute("description") );
 $("#productPrice").text("מחיר :" +img.getAttribute("price"));
var productid=img.getAttribute("productid");
$("#productid").val(productid);
preview.src=img.src;	
showCommentsByProductID();	
}
//----------------------------------------------------
function sendComment() {
 	$.ajax({ url: 'includes/functions.php',
    data: {func: 'sendComment',productidV: $("#productid").val(),commentText: $("#commet").val()},
    type: 'post',
    success: function(output) 
		{
			
		//alert(output);
		showCommentsByProductID();
		}
	});	
}
function showCommentsByProductID() {
 	$.ajax({ url: 'includes/functions.php',
    data: {func: 'showProductComments',productidV: $("#productid").val()},
    type: 'post',
    success: function(output) 
		{
			$("#commnts").html(output);
		//alert(output);
		}
	});	
}

function showUserDetails() {
 	$.ajax({ url: 'includes/functions.php',
    data: {func: 'showUserDetails'},
    type: 'post',
    success: function(output) 
		{
			$("#userDetails").html(output);
		//alert(output);
		}
	});	
}
function sendUserPsw() {


 	$.ajax({ url: 'includes/functions.php',
    data: {func: 'sendUserPsw',username:$("#usernameFRG").val()},
    type: 'post',
    success: function(output) 
		{
			
		alert(output);
		
		}
	});	
}
function updateDetails() {
	
 	$.ajax({ url: 'includes/functions.php',
    data: {func: 'updateDetails',fn:$("#fn").val(),ln:$("#ln").val(),email:$("#email").val(),phone:$("#phone").val(),address:$("#address").val()},
    type: 'post',
    success: function(output) 
		{
			
		alert(output);
		//showUserDetails();
		}
	});	
}
